#include "drv.h"

static int probe(struct device *dev)
{
    printk("mydrv %s\n", __FUNCTION__);
    return 0;
}

static int remove(struct device *dev)
{
    printk("mydrv %s\n", __FUNCTION__);
    return 0;
}

static struct device_driver mydrv = 
{
    .name = "mydrv",
    .bus = &mybus,
    .probe = probe,
    .remove = remove,
};

static int __init drv_init(void)
{
    //注册驱动
    return driver_register(&mydrv);
}

static void __exit drv_exit(void)
{
    //注销驱动
    driver_unregister(&mydrv);
}

module_init(drv_init);
module_exit(drv_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("lf");
MODULE_DESCRIPTION("This module is mydrv");
MODULE_ALIAS("mydrv");

